<template>
	<view>
		<u-popup :show="showPopup" mode="bottom" :closeable="true" @close="closePopup">
			<radio-group style="width: 100%;" @change="choosePayType">
				<view class="popup-warp">
					<view v-if="off" class="title">{{$t('请选择支付方式')}}</view>
					<view v-if="off" class="popup-item" style="border-bottom: 1px solid #e9e9e9;">
						<view>
							<u-image width="70rpx" height="70rpx"
								src="https://app.gluz.com.cn/uniappAssets//static/images/user/MemberCenter/weixin@2x.png"></u-image>
						</view>
						<view class="item-title">{{$t('微信支付')}}</view>
						<view class="right">
							<radio value="wxpay"></radio>
						</view>
					</view>
					<view class="popup-item" >
						<view>
							<u-image width="70rpx" height="70rpx"
								src="https://app.gluz.com.cn/uniappAssets//static/images/user/MemberCenter/zhifubao@2x.png"></u-image>
						</view>
						<view class="item-title">{{$t('支付宝支付')}}</view>
						<view class="right">
							<radio value="alipay"></radio>
						</view>
					</view>
				</view>
			</radio-group>
		</u-popup>

	</view>
</template>
<script>
	export default {
		props: {
			off: {
				type:Boolean,
				default:true,
			},
			show: {
				type: Boolean,
				default: true,
				required: true,
			}
		},
		data() {
			return {
				showPopup: true,
				plat: '',
			};
		},
		mounted() {
			this.off=true
			this.plat = uni.getStorageSync('plat')
			this.showPopup = this.show
		},
		methods: {
			closePopup() {
				this.$emit('close')
			},
			choosePayType(e) {
				console.log(e.detail.value)
				this.pay_type = e.detail.value
				this.$emit('change', e.detail.value)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.popup-warp {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 460rpx;
		padding: 40rpx;

		.title {
			width: 100%;
			text-align: center;
			margin: 40rpx;
		}

		.popup-item {
			height: 120rpx;
			width: 100%;
			display: flex;
			align-items: center;

			.item-title {
				margin-left: 20rpx;
			}

			.right {
				margin-left: auto;
			}
		}

	}
</style>